<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$cols = 4;
$width = (int)(100 / $cols);
?>
<h2 align="center"><?php echo $lang['campaign'].': '.$campaignname;?></h2>
<div align="center"><?php
	printf($lang['from_to_date'], date('d/m/Y',strtotime($fromdate)),date('d/m/Y',strtotime($todate)));
?></div><br /><br />
<table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #ccc;">
    <tr class="theader">
        <td width="20%" style="border:1px solid #ccc;"> <?php echo $lang['date'];?> </td>
        <td width="80%" style="border:1px solid #ccc;"> Ip </td>
    </tr>
</table>
<?php foreach($items as $key => $item){?>
    		<?php
    		$table_limit = 1000;
    		$n = count($item);
    		for($k = 0; $k < $n; $k += $table_limit){
    		?>
<table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #ccc;">
    <tr>
    	<td width="20%"><?php
    		if($k == 0) echo $key.'<br>('.$lang['sum_ip'].': '.number_format(count($item)).')';
    		else echo " ";
    	?></td>
    	<td width="80%">
    		<table cellpadding="0" cellspacing="0" width="100%">
    			<?php
    			$loop = 1;
    			$ii = 0;
    			for ($ii; $ii < $table_limit && ($ii + $k) < $n; $ii++)
    			{
    				$ip = &$item[$ii + $k];
    				
    				if($loop == 1) echo '<tr>';
    				echo '<td>'.trim($ip).'</td>';
    				if($loop == $cols)
    				{
    					echo "</tr>\n";
    					$loop = 1;
    				}
    				else $loop++;
    			}
    			if($loop > 1 && ($ii + $k) >= $n)
    			{
    				for ($i = $loop; $i <= $cols; $i++) echo '<td></td>';
    				echo "</tr>\n";
    			}
    			?>
    		</table>
		</td>
    </tr>
</table>
    	<?php }?>
<?php }?>
<p><?php echo $lang['export_ips_note'];?></p>